package com.mzkj.wanjulaile.mobile.api.modules.session.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.mzkj.wanjulaile.mobile.api.common.entity.DataEntity;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

/**
 * 接口会话类
 * Created by wangxw on 2016/12/13.
 */
public class Session extends DataEntity<Session> {

    @JSONField(serialize = false)
    private String id;
    /**
     * account id
     */
    @NotNull
    @JSONField(serialize = false)
    private String accountId;
    /**
     * 0-无效,1-有效
     */
    @JSONField(serialize = false)
    private Integer valid;
    /**
     * token
     */
    @NotNull
    private String accessToken;
    /**
     * 刷新token
     */
    @NotNull
    private String refreshToken;
    /**
     * 有效期
     */
    @NotNull
    private Long expiresIn;
    /**
     * 授权方式Scope
     */
    private String scope;

    /**
     * 客户端类型 android、ios、web
     */
    private String clientType;

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    public Integer getValid() {
        return valid;
    }

    public void setValid(Integer valid) {
        this.valid = valid;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    public Long getExpiresIn() {
        return expiresIn;
    }

    public void setExpiresIn(Long expiresIn) {
        this.expiresIn = expiresIn;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    @Override
    public String toString() {
        return "Session{" +
                "id='" + id + '\'' +
                ", accountId='" + accountId + '\'' +
                ", valid=" + valid +
                ", accessToken='" + accessToken + '\'' +
                ", refreshToken='" + refreshToken + '\'' +
                ", expiresIn=" + expiresIn +
                ", scope='" + scope + '\'' +
                ", clientType='" + clientType + '\'' +
                '}';
    }
}
